/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: max.jianhua
 * @Last Modified time: 2020-11-20 15:21:28
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 折扣政策设置
export const queryList = (params) => axios.post(`${SERVER.WHOLESALES}/DiscountRuleSettings/DiscountRuleList`, params)

// 根据id获取返利规则
export const findById = (params) => axios.get(`${SERVER.WHOLESALES}/DiscountRuleSettings/DiscountRulefindById`, {
  params
})

//下载模板
export const downAssemblyTem = params => {
  return axios({
    url:`${SERVER.WHOLESALES}/DiscountRuleSettings/downAssemblyTem`,
    method:'get',
    // params:params,
    responseType: 'blob'
  });
};

// //导入
// export const ImportExcel = params => {
//   return axios({
//     url:`${SERVER.WHOLESALES}/DiscountRuleSettings/upload`,
//     method:'post',
//     // params:params,
//     responseType: 'blob'
//   });
// };

// 导入	/tmFiTripartiteBank/upload
export const upload = (params) => axios.post(`${SERVER.WHOLESALES}/DiscountRuleSettings/upload`, params)
// 返利规则新增/修改
export const saveRule = (params) => axios.post(`${SERVER.WHOLESALES}/DiscountRuleSettings/DiscountRulesaveRule`, params)

// 选装查询  vehicleProduct/options
export const options = (params) => axios.get(`${SERVER.BASEDATA}/vehicleProduct/options`, {
  params
})
